using System.ServiceModel.Channels;
using System.Xml;

namespace HengTong.Kingdee.Eas;

public class EasMessageHeader(string value) : MessageHeader
{
    private string Prefix => "ns1";
    private string Value { get; } = value;
    public override string Name => "SessionId";
    public override string Namespace => "http://login.webservice.bos.kingdee.com";

    protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
    {
        writer.WriteValue(Value);
    }

    protected override void OnWriteStartHeader(XmlDictionaryWriter writer, MessageVersion messageVersion)
    {
        writer.WriteStartElement(Prefix, Name, Namespace);
    }
}